﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Text;
using xiaodingmarket_Domain.Models;

namespace xiaodingmarket_Infra_Data.Mapping
{
    public class ReportMap : IEntityTypeConfiguration<Report>
    {
        public void Configure(EntityTypeBuilder<Report> builder)
        {
            builder.HasOne(p => p.Reportprocess).WithOne(p => p.report)
                .HasForeignKey<Reportprocess>(k => k.Id)
                .OnDelete(DeleteBehavior.Cascade);//设置级联删除   
        }
    }
}
